/**
 * @判断是否登录
 * @没登录就跳到登录页
 */

import router from "@/router";
import progress from "nprogress";
import "nprogress/nprogress.css";
import { routesWhiteList, title } from "@/config";
progress.configure({
  easing: "ease",
  speed: 500,
  trickleSpeed: 200,
  showSpinner: false,
});

router.beforeEach(async (to, from, next) => {
  // 显示进度条
  progress.start();
  console.log("to", to);
  console.log("from", from);
  next();
});
router.afterEach((to) => {
  console.log(to);
  if (to.name) document.title = title + "-" + to.name;
  else document.title = title;
  if (progress.status) progress.done();
});
